package com.dianping.cat.home.heavy.entity;

import com.dianping.cat.home.heavy.BaseEntity;
import com.dianping.cat.home.heavy.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;

public class HeavyCache
  extends BaseEntity<HeavyCache> {
/*  10 */   private Map<String, Url> m_urls = new LinkedHashMap();

/*  12 */   private Map<String, Service> m_services = new LinkedHashMap();






/*  19 */   public void accept(IVisitor visitor) { visitor.visitHeavyCache(this); }

  
  public HeavyCache addService(Service service) {
/*  23 */     this.m_services.put(service.getKey(), service);
    return this;
  }
  
  public HeavyCache addUrl(Url url) {
/*  28 */     this.m_urls.put(url.getKey(), url);
    return this;
  }

  
  public boolean equals(Object obj) {
/*  34 */     if (obj instanceof HeavyCache) {
/*  35 */       HeavyCache _o = (HeavyCache)obj;

/*  37 */       if (!equals(getUrls(), _o.getUrls())) {
/*  38 */         return false;
      }
      
/*  41 */       if (!equals(getServices(), _o.getServices())) {
/*  42 */         return false;
      }

      
/*  46 */       return true;
    }
    
/*  49 */     return false;
  }

  
/*  53 */   public Service findService(String key) { return (Service)this.m_services.get(key); }



/*  57 */   public Url findUrl(String key) { return (Url)this.m_urls.get(key); }

  
  public Service findOrCreateService(String key) {
/*  61 */     Service service = (Service)this.m_services.get(key);

/*  63 */     if (service == null) {
/*  64 */       synchronized (this.m_services) {
/*  65 */         service = (Service)this.m_services.get(key);

/*  67 */         if (service == null) {
/*  68 */           service = new Service(key);
/*  69 */           this.m_services.put(key, service);
        }
      }
    }
    
/*  74 */     return service;
  }
  
  public Url findOrCreateUrl(String key) {
    Url url = (Url)this.m_urls.get(key);

/*  80 */     if (url == null) {
/*  81 */       synchronized (this.m_urls) {
/*  82 */         url = (Url)this.m_urls.get(key);

/*  84 */         if (url == null) {
/*  85 */           url = new Url(key);
/*  86 */           this.m_urls.put(key, url);
        }
      }
    }
    
/*  91 */     return url;
  }

  
  public Map<String, Service> getServices() { return this.m_services; }



/*  99 */   public Map<String, Url> getUrls() { return this.m_urls; }


  
  public int hashCode() {
/* 104 */     int hash = 0;

/* 106 */     hash = hash * 31 + ((this.m_urls == null) ? 0 : this.m_urls.hashCode());
/* 107 */     return hash * 31 + ((this.m_services == null) ? 0 : this.m_services.hashCode());
  }



  
  public void mergeAttributes(HeavyCache other) {}


  
/* 117 */   public Service removeService(String key) { return (Service)this.m_services.remove(key); }



/* 121 */   public Url removeUrl(String key) { return (Url)this.m_urls.remove(key); }
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/classes/!/com/dianping/cat/home/heavy/entity/HeavyCache.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */